package com.toubutu.audio.service;

import com.toubutu.audio.admin.dto.MergeFileDto;
import com.toubutu.audio.admin.dto.UploadFileDto;
import com.toubutu.audio.entity.UploadFileRecord;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.concurrent.ExecutionException;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 戒躁
 * @since 2024-01-08
 */
public interface UploadFileRecordService extends IService<UploadFileRecord> {
    String uploadFileBySlice(UploadFileDto uploadFileDto) throws IOException;

    /**
     * 文件是否存在 如果存在则返回文件链接,不存在返回null
     * @param md5 文件md5
     * @return url
     */
    String fileIsExist(String md5);

    void mergeFile(MergeFileDto mergeFileDto) throws ExecutionException, InterruptedException, FileNotFoundException;
}
